<extend name="Public:layout" />
<block name="main-content">
	<div class="main container">
		<div class="row ">
			<div class="col-lg-9 col-md-9 col-sm-9">
				<div class="">
					<ol class="breadcrumb">
					  <li><a href="__APP__/Bbs">社区</a></li>
					  <li class="active"><a href="__APP__/topic/topicList/id/{$community.id}">{$community.comm_name}22</a></li>
					</ol>
				</div>
				<!--左边内容-->
				<div class="topic ">
					<h3>{$topic.topic_title}</h3>
					<hr>
				
					<div class="titem ">
						<div class="row">
							
							<div class="col-lg-3 col-md-3 col-sm-3 tc3">
								<img src="__PUBLIC__/home/images/1.jpg" alt="" class="man-pic img-circle">
								<p class="text-center lname"><span>楼主</span><span class="red">人名</span></p>
							</div>
							<div class="col-lg-9 col-md-9 col-sm-9 tc9">
								<div class="tcontent" >
									{$topic.article_content}
								</div>
								<div class="t-bottom text-right">
									{$topic.create_time}
								</div>
							</div>
						</div>
						<hr>
					</div>
					<volist name="comment" id="c">
						<div class="titem row">
							<div class="col-lg-3 col-md-3 col-sm-3 tc3">
								<img src="__PUBLIC__/home/images/1.jpg" alt="" class="man-pic img-circle">
								<p class="text-center lname"><span class="red">人名</span></p>
							</div>
							<div class="col-lg-9 col-md-9 col-sm-9 tc9">
								<div class="tcontent" >
									{$c.comment_content}
								</div>
								<div class="t-bottom text-right">
									{$c.create_time}
								</div>
							</div>
							<hr>
						</div>
					</volist>
				</div>
				<div class="page">
					{$page}
				</div>
				<div class="doComment">
					<h4>发表回复</h4>
					<textarea class="form-control mycomment" rows="4"></textarea>
					<input type="hidden" name="id" id="id" value="{$topic.id}">
					<button class="btn btn-primary doC">发表</button>
				</div>
			</div>
			<script>
				$(function(){
					$('.doC').click(function(event) {
						var v = $('.mycomment').val();
						var t =getNowFormatDate();
						var h = '<div class="titem "><div class="row">'+
							'<div class="col-lg-3 col-md-3 col-sm-3 tc3">'+
								'<img src="__PUBLIC__/home/images/1.jpg" alt="" class="man-pic img-circle">'+
								'<p class="text-center lname"><span class="red">人名</span></p>'+
							'</div>'+
							'<div class="col-lg-9 col-md-9 col-sm-9 tc9">'+
								'<div class="tcontent" >'+v+'</div>'+
								'<div class="t-bottom text-right">'+t+'</div>'+
							'</div></div>'+
							'<hr>'+
						'</div>';
						
						if (v!='') {
							var id = $("#id").val();
							$.ajax({
								url:"__APP__/Topic/commentTopic",
								type:'POST',
								dataType:'json',
								data:{v:v,i:id},
								success:function(m){
									if (m.status) {
										
										$(".topic").append(h);
										$('.mycomment').val(" ");
									}
									alert(m.msg);
								}
							});
						}else{
							alert("不能为空");
						}
					});
					
				});
				function getNowFormatDate() {
				    var date = new Date();
				    var seperator1 = "-";
				    var seperator2 = ":";
				    var month = date.getMonth() + 1;
				    var strDate = date.getDate();
				    if (month >= 1 && month <= 9) {
				        month = "0" + month;
				    }
				    if (strDate >= 0 && strDate <= 9) {
				        strDate = "0" + strDate;
				    }
				    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
				            + " " + date.getHours() + seperator2 + date.getMinutes()
				            + seperator2 + date.getSeconds();
				    return currentdate;
				}
				function post(data,url){
					$.ajax({
						url:url,
						type:'POST',
						dataType:'json',
						data:data,
						successs:function(m){
							if (m.status==1) {
								alert(m.msg);
							}else{
								alert("失败");
							}
						}
					})
				}
			</script>
			<div class="col-lg-3 col-md-3 col-sm-3">
				<div class="hot-essay">
					<h4>热门话题</h4>
					<div class="he ">
						<volist name="hoteassy" id="he">
						<div class="he-item row">
							<div class="col-lg-3 col-md-3 col-sm-3">
								<img src="{$he.img}" alt="">
							</div>
							<div class="col-lg-9 col-md-9 col-sm-9">
								<a href="">{$he.article_title}</a>
								<div class="rb">
									<span class="date">{$he.create_time}</span>
									<span class="glyphicon glyphicon-eye-open"></span><span>{$he.click_num}</span>
								</div>
							</div>
						</div>
						</volist>
						<div class="he-item row">
							<div class="col-lg-3 col-md-3 col-sm-3">
								<img src="__PUBLIC__/home/images/1.jpg" alt="">
							</div>
							<div class="col-lg-9 col-md-9 col-sm-9">
								<a href="">世界和你</a>
								<div class="rb">
									<span class="date">2016-12-25</span>
									<span class="glyphicon glyphicon-eye-open"></span><span>14</span>
								</div>
							</div>
						</div>
						<div class="he-item row">
							<div class="col-lg-3 col-md-3 col-sm-3">
								<img src="__PUBLIC__/home/images/1.jpg" alt="">
							</div>
							<div class="col-lg-9 col-md-9 col-sm-9">
								<a href="">芝麻与绿豆，还有糖</a>
								<div class="rb">
									<span class="date">2016-12-25</span>
									<span class="glyphicon glyphicon-eye-open"></span><span>14</span>
								</div>
							</div>
						</div>
						<div class="he-item row">
							<div class="col-lg-3 col-md-3 col-sm-3">
								<img src="__PUBLIC__/home/images/1.jpg" alt="">
							</div>
							<div class="col-lg-9 col-md-9 col-sm-9">
								<a href="">芝麻与绿豆，还有糖</a>
								<div class="rb">
									<span class="date">2016-12-25</span>
									<span class="glyphicon glyphicon-eye-open"></span><span>14</span>
								</div>
							</div>
						</div>
						
					</div>
				</div>
			</div>

		</div>
	</div>
</block>